*** Figure B1
clear all
import excel "$path\Output\Compile_Tables.xlsx", firstrow cellrange(A1:D27) sheet(FigB1)

gen bar_high = SE*1.96+Coeff
gen bar_low = -SE*1.96+Coeff

twoway (rarea bar_low bar_high Year if Country=="Germany", sort color(gs12%20)) ///
       (line Coeff Year if Country=="Germany", lcolor(black)) ///
       (line Coeff Year if Country=="US", lcolor(black) lpattern(dash)) ///
       (rcap bar_low bar_high Year if Country=="US", lcolor(black) lpattern(dash)), ///
       ytitle("Coefficient on Communist x Year")  ///
       xtitle("Year")  ///
       xlabel(#13, angle(45))  ///
       ylabel(, format(%2.1f))  ///
       graphregion(color(white))  ///
       legend(pos(6) row(1) label(2 "Germany") label(3 "US") order(2 3))

graph export "$path\Output\figb1.pdf", replace


*** Figure B4
clear all
import excel "$path\Output\Compile_Tables.xlsx", firstrow cellrange(A1:D23) sheet(FigB4)

gen order = _n
gen barlength = SE*1.96

*Germany
serrbar Coeff barlength order if Country=="Germany", xlabel(1 "Full Sample" 2 "Poland" 3 "Romania" 4 "Hungary" 5 "Czechoslovakia" 6 "Bulgaria" 7 "Russia" 8 "Ukraine", angle(90)) ytitle("Coefficient on Communist x Post-93") xtitle("") title("Germany") graphregion(color(white)) lc(gs10) mvopts(mcolor(gs0))

graph save "$path\Tempfiles\figb4_1.gph", replace

*US
serrbar Coeff barlength order if Country=="US", xlabel(9 "Full Sample" 10 "Poland" 11 "Romania" 12 "Hungary" 13 "Czechoslovakia" 14 "Bulgaria" 15 "Russia", angle(90)) ytitle("Coefficient on Communist x Post-93") xtitle("") title("US")  graphregion(color(white)) lc(gs10) mvopts(mcolor(gs0))
graph save "$path\Tempfiles\figb4_2.gph", replace

*Israel
serrbar Coeff barlength order if Country=="Israel", xlabel(16 "Full Sample" 17 "Poland" 18 "Romania" 19 "Hungary" 20 "Bulgaria" 21 "Russia" 22 "Ukraine", angle(90)) ytitle("Coefficient on Communist x Post-92") xtitle("") title("Israel")  graphregion(color(white)) lc(gs10) mvopts(mcolor(gs0))
graph save "$path\Tempfiles\figb4_3.gph", replace

graph combine "$path\Tempfiles\figb4_1.gph" "$path\Tempfiles\figb4_2.gph" "$path\Tempfiles\figb4_3.gph", rows(1) ycommon graphregion(color(white)) iscale(1) graphregion(color(white))

graph export "$path\Output\figb4.pdf", replace

sleep 500
erase "$path\Tempfiles\figb4_1.gph"
erase "$path\Tempfiles\figb4_2.gph"
erase "$path\Tempfiles\figb4_3.gph"